]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
shellDBus: Accept connector to restrict OSD to one monitor
authorBenjamin Berg <bberg@redhat.com>
Thu, 11 Apr 2019 09:43:03 +0000 (11:43 +0200)
committerFlorian Müllner <florian.muellner@gmail.com>
Thu, 11 Apr 2019 18:53:53 +0000 (18:53 +0000)
The monitor index is not something that gnome-shell and
gnome-settings-daemon seem to be agreeing about. Using the connector
string is a much more reliable method of identifying a specific screen
and we are indeed using this already for monitor labling.

So switch over to use the connector rather than the monitor index. If a
user tries to use the old API, then the OSD will simply show up on all
monitors (which is the status quo currently anyway).

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/489

js/ui/shellDBus.js

index b1f2be2b365432e7ebee59f4d2eea0f3b822c631..19d07acce619f74734e89a24a2ddd94772ec81ec 100644 (file)
@@ -79,14 +79,17 @@ var GnomeShell = class {
         for (let param in params)
             params[param] = params[param].deep_unpack();
 
-        let { monitor: monitorIndex,
+        let { connector,
               label,
               level,
               max_level: maxLevel,
               icon: serializedIcon } = params;
 
-        if (monitorIndex === undefined)
-            monitorIndex = -1;
+        let monitorIndex = -1;
+        if (connector) {
+            let monitorManager = Meta.MonitorManager.get();
+            monitorIndex = monitorManager.get_monitor_for_connector(connector);
+        }
 
         let icon = null;
         if (serializedIcon)